<?php
namespace App\Common\Services\Date;


use Illuminate\Http\Request;
use com\nlf\calendar\Lunar;
class DateLunar
{
    /**
     * 获取农历信息
     *
     * @param [type] $datestr---2021-05-05
     * @return void
     */
    public static function getLunarDate($datestr){

        $d = Lunar::fromDate(new \DateTime($datestr));
        echo $d."\n";
        echo $d->toFullString()."\n";
        echo $d->getYear()."\n";
        echo $d->getMonth()."\n";
        echo $d->getDay()."\n";
    }
}